USE [CTEM-DB-v1]
GO

/****** Object:  StoredProcedure [dbo].[Employee_GetAdvance]    Script Date: 02/10/2012 11:26:14 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:		TIENDH
-- Create date: 06/06/2011
-- Description:	abc
-- =============================================
CREATE PROCEDURE [dbo].[Employee_GetAdvance] 
	@Name		NVARCHAR(150),
	@FromDate	DATETIME,
	@ToDate		DATETIME,
	@Type		NVARCHAR(50)
AS
BEGIN
	SELECT	A.*, E.Username, E.FullName
	FROM	Advance A JOIN Employee E ON A.EmployeeID = E.EmployeeID
	WHERE	E.FullName LIKE N'%' + @Name + '%' AND
			A.DateAdvance BETWEEN @FromDate AND @ToDate AND
			A.Type LIKE N'%' + @Type + '%'
END

GO

